package com.tarena.csmall.rocketmq.demo.consumer;

import com.tarena.csmall.rocketmq.demo.service.HelloService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
    topic:消费端绑定主题
    consumerGroup:消费者分组
    selectorExpression: 顾虑的标签
 */
@Component
@RocketMQMessageListener(
        topic = "trans-test-topic",
        consumerGroup = "trans-group",
        selectorExpression = "*")
public class MyConsumerListenerTrans implements RocketMQListener<String> {

    @Override
    public void onMessage(String name) {

        System.out.println(name);
        //System.out.println("消费端接收到消息:"+name);
    }
}
